Thermal air flow sensors capable of directly detecting an air flow rate have been a mainstream trend in the air flow sensor. Particularly gaining attention are thermal air flow sensors including measuring elements fabricated in a semiconductor micromachining technique because of their lower cost and capability of being driven at low electric power. Patent Document 1 discloses a measuring element included in such a thermal air flow sensor. The thermal air flow sensor disclosed in Patent Document 1 includes an electric insulating film formed over a semiconductor substrate, thin films of a heating resistor and a temperature measuring resistor formed over the electric insulating film, and an electric insulator formed over the heating resistor and the temperature measuring resistor. The thermal air flow sensor further includes a diaphragm structure formed in a region in which the heating resistor and the temperature measuring resistor are formed. The diaphragm structure is formed after part of the semiconductor substrate is removed as a result of anisotropic etching performed from a back side of the semiconductor substrate.